package cn.cmeizu.spring6.iocxml.ditest;

import java.util.Arrays;

/**
 * @author cmeizu
 * @date 2023/2/8 23:44
 */
public class Emp {
  //对象类型的属性: 员工属于某个部门
  private Dept dept;

  public Dept getDept() {
    return dept;
  }

  public void setDept(Dept dept) {
    this.dept = dept;
  }

  public String getEname() {
    return ename;
  }

  public void setEname(String ename) {
    this.ename = ename;
  }

  public String getAge() {
    return age;
  }

  public void setAge(String age) {
    this.age = age;
  }

  /**
   * 员工姓名
   */
  private String ename;
  /**
   * 员工年龄
   */
  private String age;

  @Override
  public String toString() {
    return "Emp{" +
        "dept=" + dept +
        ", ename='" + ename + '\'' +
        ", age='" + age + '\'' +
        ", loves=" + Arrays.toString(loves) +
        '}';
  }

  public String[] getLoves() {
    return loves;
  }

  public void setLoves(String[] loves) {
    this.loves = loves;
  }

  /**
   * 员工爱好
   */
  private String[] loves;

  public void work() {
    System.out.println(ename + "员工正在工作" + age);
    dept.info();
    System.out.println(Arrays.toString(loves));
  }
}
